﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary.Data;
using System.Data;
using ClassLibrary.Entity;

namespace ClassLibrary.DAO
{
    public class TblCustomerDAO
    {
         private DBService _db = null;

         public TblCustomerDAO(String connectionString)
          {
              _db = new DBService(connectionString);
          }
         public bool Insert_Update(TblCustomer user, int mode)
          {
              bool flag = false;
              try
              {             
                    _db.ExeSP_NonQuery("sp_TblCustomer_InsUpd",
                      new string[] { "@CusID", "@CusName", "@Email", "@Pass", "@CusAdress", "@Phone", "@IsAdmin", "@Mode" },
                      new object[] { user.CusID, user.CusName, user.Email, user.Pass, user.CusAdress, user.Phone, user.IsAdmin, mode },
                      CommandType.StoredProcedure);

                  flag = true;
              }
              catch (Exception ex)
              {
                  throw ex;
              }
              return flag;
          }

    }
}
